// 这两个方法本质上就是返回一个对象，可以根据需要自行增加修改
import { networkRequest } from "./apiConfig";
const get = (url, config)  => ({url, method: "get", ...config });
const post = (url, config) => ({url, method: "post", ...config });

/**
 * key 名称取接口名称驼峰写法
 * 其他按照下方示例
 */
const apiList = {
	userGetListByCon:(param)=>networkRequest(get("api/user/getListByCon", { loading: "加载中..." }),param),
	supplierChannelGetSupplierList:(param)=>networkRequest(post("api/supplier/channel/supplierChannel/getSupplierList", { loading: "加载中..." }),param),
	// 创建新标准
	userPortalCreate:(param)=>networkRequest(post("api/UserPortal/standard/create", { loading: "加载中..." }),param),
	// 分级列表
	userPortalGetLogic:(param)=>networkRequest(post("api/UserPortal/standard/getLogicRelationship", { loading: "加载中..." }),param),
	//查询
	userPortalGetListByCon:(param)=>networkRequest(post("api/UserPortal/standard/getListByCon", { loading: "加载中..." }),param),
	//导出
	userPortalEmailSendRecordCreate:(param)=>networkRequest(post("api/UserPortal/emailSendRecord/create", { loading: "加载中..." }),param),
	// 确认权限
	UserPortalStandardVerifyCode:(param)=>networkRequest(post("api/UserPortal/standard/verifyCode", { loading: "加载中..." }),param),
	userPortalConfigByColumn:(param)=>networkRequest(post("api/UserPortal/standardConfig/getOptionsByColumn", { loading: "加载中..." }),param),
	userPortalGetUnderCentralized:(param)=>networkRequest(post("api/UserPortal/standard/getUnderCentralized", { loading: "加载中..." }),param),
	userPortalGetObj:(param)=>networkRequest(post("api/UserPortal/standard/getObj", { loading: "加载中..." }),param),
	userPortalGetSubClass:(param)=>networkRequest(post("api/UserPortal/standard/getSubClass", { loading: "加载中..." }),param),
	userPortalGetGroup:(param)=>networkRequest(post("api/UserPortal/standard/getGroups", { loading: "加载中..." }),param),
	userPortalGetSubType:(param)=>networkRequest(post("api/UserPortal/standard/getSubType", { loading: "加载中..." }),param),
	userPortalGetAnnualNumber:(param)=>networkRequest(post("api/UserPortal/statistics/getAnnualNumber", { loading: "加载中..." }),param),
	userPortalGetById:(param)=>networkRequest(post("api/UserPortal/standard/getById", { loading: "加载中..." }),param),
	userPortalEdit:(param)=>networkRequest(post("api/UserPortal/standard/edit", { loading: "加载中..." }),param),
	userPortalGetEffective:(param)=>networkRequest(post("api/UserPortal/statistics/getEffectiveProportion", { loading: "加载中..." }),param),
	userPortalGetDepartment:(param)=>networkRequest(post("api/UserPortal/statistics/getDepartmentNum", { loading: "加载中..." }),param),
	userPortalGeUnderCentralizedNum:(param)=>networkRequest(post("api/UserPortal/statistics/getUnderCentralizedNum", { loading: "加载中..." }),param),
	userPortalGeClazz:(param)=>networkRequest(post("api/UserPortal/statistics/getClazzNum", { loading: "加载中..." }),param),
	userPortalGetType:(param)=>networkRequest(post("api/UserPortal/statistics/getTypeNum", { loading: "加载中..." }),param),
	userPortalGetGroupNum:(param)=>networkRequest(post("api/UserPortal/statistics/getGroupsNum", { loading: "加载中..." }),param),
	userPortalGetClazzByNum:(param)=>networkRequest(post("api/UserPortal/statistics/getSubClassByClazzNum", { loading: "加载中..." }),param),
	userPortalGetTypeNumByNum:(param)=>networkRequest(post("api/UserPortal/statistics/getSubTypeByTypeNum", { loading: "加载中..." }),param),
	userPortalGetGroupsNumByNum:(param)=>networkRequest(post("api/UserPortal/statistics/getSubGroupByGroupsNum", { loading: "加载中..." }),param),
	userPortalGetOptionByIndex:(param)=>networkRequest(post("api/UserPortal/standardConfig/getOptionsByIndex", { loading: "加载中..." }),param),
};

// 公共Api
const commonApiList = {
	commonGetQiniuToken:(param, unknown)=>networkRequest(post("api/common/getQiniuToken", { loading: "加载中..." }),param),
};


// 以下为示例

// // 单纯地调用接口(接口名, 接口路径[不包含base路径])
// get('api/index/home1'),
//
// // 调用该接口时，将显示loading并在下方显示文字“加载中”，并在result为false时，显示“加载首页信息失败”的提示
// post('api/index/home3', { loading: '加载中'),

// // 为接口设置一个默认的参数
// get('api/index/home5', {apiParams: { level: 1 } }),

export { apiList ,commonApiList};
